package com.small.springframework;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * bean工厂
 * @Author zhoujin
 * @Date 2022/3/29 16:21
 */
public class BeanFactory {

    Map<String,BeanDefinition> beanDefinitionMap = new ConcurrentHashMap();

    public Object getBean(String name){
        return beanDefinitionMap.get(name).getBean();
    }

    public void registerBean(String name,BeanDefinition beanDefinition){
        beanDefinitionMap.put(name,beanDefinition);
    }

}
